{% extends "base.html" %}
{% load i18n %}
{% block title %} Tu Negocio Empresarios - Historial Inventario{% endblock %}

{% block head-css-ext %}
  <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/layout.css" media="screen" />
  <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/blue/style.css" media="print, projection, screen" />
{% endblock %}

{% block head-js-ext %}
  <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.js"></script>
  <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.tablesorter.js"></script>
  <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.tablePagination.js"></script>
  <script type="text/javascript" src="{{MEDIA_URL}}js/jquery.translate.js"></script>
{% endblock %}

{% block head-js-embedded %}
  <script type="text/javascript">
	$(document).ready(function(){
	  var options = {
		firstArrow : (new Image()).src="{{MEDIA_URL}}img/icons/first.png",
		prevArrow : (new Image()).src="{{MEDIA_URL}}img/icons/prev.png",
		lastArrow : (new Image()).src="{{MEDIA_URL}}img/icons/last.png",
		nextArrow : (new Image()).src="{{MEDIA_URL}}img/icons/next.png"
	  }
	  $("#historial-inventario")
		.tablesorter({widthFixed: true,  widgets: ['zebra'] })
		.tablePagination(options);
	  
	  $("#tablePagination").translate('en', 'es');
	  
	});	
  </script>
{% endblock %}


{% block content-box1 %}
  <b> Historial Inventario de {{ usuario.first_name }} {{ usuario.last_name }}</b>
  <br><br>
  {% if historial %}
	<table id="historial-inventario" class="tablesorter">
	  <thead>
		<tr align="center">
          <th>Producto</th>
          <th>Fecha&nbsp;&nbsp;&nbsp;</th>
          <th>Cantidad</th>		  
          <th>Tipo de Movimiento</th>
        </tr>            
      </thead>
      <tbody>
		{% for producto in historial %}
		  <tr align="center">
            <td>{{ producto.inventario }}</td>
			<td>{{ producto.fecha|date:"d M Y" }}</td>
            <td>{{ producto.cantidad }}</td>
			<td>{{ producto.transaccion }}</td>
		  </tr>
        {% endfor %}
      </tbody>
    </table>      
  {% else %}
	<p><b>No tiene Movientos en su Inventario, porque no ha cargado productos</b></p>
  {% endif %}
{% endblock %}

{% block content-colum2 %}
  {% if user.is_authenticated %}
	<ul>
	  <li><a href="{% url index %}">{% trans "Home" %}</a></li>
	  <li><a href="{% url inventario %}">Inventario</a></li>
	  <li><a href="{% url ver_inventario %}">Ver Inventario</a></li>
	  <li><a href="{% url agregar_productos_inventario %}">Agregar Productos Inventario</a></li> 
    </ul>
  {% endif %}   
{% endblock %}